home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / necko / nsIResProtocolHandler.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  5KB  |  154 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIResProtocolHandler.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIResProtocolHandler_h__
  6. #define __gen_nsIResProtocolHandler_h__
  7.  
  8.  
  9. #ifndef __gen_nsIProtocolHandler_h__
  10. #include "nsIProtocolHandler.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. #include "nsAString.h"
  18.  
  19. /* starting interface:    nsIResProtocolHandler */
  20. #define NS_IRESPROTOCOLHANDLER_IID_STR "067ca872-e947-4bd6-8946-a479cb6ba5dd"
  21.  
  22. #define NS_IRESPROTOCOLHANDLER_IID \
  23.   {0x067ca872, 0xe947, 0x4bd6, \
  24.     { 0x89, 0x46, 0xa4, 0x79, 0xcb, 0x6b, 0xa5, 0xdd }}
  25.  
  26. /**
  27.  * Protocol handler interface for the resource:// protocol
  28.  */
  29. class NS_NO_VTABLE nsIResProtocolHandler : public nsIProtocolHandler {
  30.  public: 
  31.  
  32.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IRESPROTOCOLHANDLER_IID)
  33.  
  34.   /**
  35.      * Sets the substitution for the root key:
  36.      *   resource://root/path ==> baseURI.resolve(path)
  37.      *
  38.      * A null baseURI removes the specified substitution.
  39.      *
  40.      * A root key should always be lowercase; however, this may not be
  41.      * enforced.
  42.      */
  43.   /* void setSubstitution (in ACString root, in nsIURI baseURI); */
  44.   NS_IMETHOD SetSubstitution(const nsACString & root, nsIURI *baseURI) = 0;
  45.  
  46.   /**
  47.      * Gets the substitution for the root key.
  48.      *
  49.      * @throws NS_ERROR_NOT_AVAILABLE if none exists.
  50.      */
  51.   /* nsIURI getSubstitution (in ACString root); */
  52.   NS_IMETHOD GetSubstitution(const nsACString & root, nsIURI **_retval) = 0;
  53.  
  54.   /**
  55.      * Returns TRUE if the substitution exists and FALSE otherwise.
  56.      */
  57.   /* boolean hasSubstitution (in ACString root); */
  58.   NS_IMETHOD HasSubstitution(const nsACString & root, PRBool *_retval) = 0;
  59.  
  60.   /**
  61.      * Utility function to resolve a resource URI.  A resolved URI is not 
  62.      * guaranteed to reference a resource that exists (ie. opening a channel to
  63.      * the resolved URI may fail).
  64.      *
  65.      * @throws NS_ERROR_NOT_AVAILABLE if resURI.host() is an unknown root key.
  66.      */
  67.   /* AUTF8String resolveURI (in nsIURI resURI); */
  68.   NS_IMETHOD ResolveURI(nsIURI *resURI, nsACString & _retval) = 0;
  69.  
  70. };
  71.  
  72. /* Use this macro when declaring classes that implement this interface. */
  73. #define NS_DECL_NSIRESPROTOCOLHANDLER \
  74.   NS_IMETHOD SetSubstitution(const nsACString & root, nsIURI *baseURI); \
  75.   NS_IMETHOD GetSubstitution(const nsACString & root, nsIURI **_retval); \
  76.   NS_IMETHOD HasSubstitution(const nsACString & root, PRBool *_retval); \
  77.   NS_IMETHOD ResolveURI(nsIURI *resURI, nsACString & _retval); 
  78.  
  79. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  80. #define NS_FORWARD_NSIRESPROTOCOLHANDLER(_to) \
  81.   NS_IMETHOD SetSubstitution(const nsACString & root, nsIURI *baseURI) { return _to SetSubstitution(root, baseURI); } \
  82.   NS_IMETHOD GetSubstitution(const nsACString & root, nsIURI **_retval) { return _to GetSubstitution(root, _retval); } \
  83.   NS_IMETHOD HasSubstitution(const nsACString & root, PRBool *_retval) { return _to HasSubstitution(root, _retval); } \
  84.   NS_IMETHOD ResolveURI(nsIURI *resURI, nsACString & _retval) { return _to ResolveURI(resURI, _retval); } 
  85.  
  86. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  87. #define NS_FORWARD_SAFE_NSIRESPROTOCOLHANDLER(_to) \
  88.   NS_IMETHOD SetSubstitution(const nsACString & root, nsIURI *baseURI) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetSubstitution(root, baseURI); } \
  89.   NS_IMETHOD GetSubstitution(const nsACString & root, nsIURI **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSubstitution(root, _retval); } \
  90.   NS_IMETHOD HasSubstitution(const nsACString & root, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->HasSubstitution(root, _retval); } \
  91.   NS_IMETHOD ResolveURI(nsIURI *resURI, nsACString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ResolveURI(resURI, _retval); } 
  92.  
  93. #if 0
  94. /* Use the code below as a template for the implementation class for this interface. */
  95.  
  96. /* Header file */
  97. class nsResProtocolHandler : public nsIResProtocolHandler
  98. {
  99. public:
  100.   NS_DECL_ISUPPORTS
  101.   NS_DECL_NSIRESPROTOCOLHANDLER
  102.  
  103.   nsResProtocolHandler();
  104.  
  105. private:
  106.   ~nsResProtocolHandler();
  107.  
  108. protected:
  109.   /* additional members */
  110. };
  111.  
  112. /* Implementation file */
  113. NS_IMPL_ISUPPORTS1(nsResProtocolHandler, nsIResProtocolHandler)
  114.  
  115. nsResProtocolHandler::nsResProtocolHandler()
  116. {
  117.   /* member initializers and constructor code */
  118. }
  119.  
  120. nsResProtocolHandler::~nsResProtocolHandler()
  121. {
  122.   /* destructor code */
  123. }
  124.  
  125. /* void setSubstitution (in ACString root, in nsIURI baseURI); */
  126. NS_IMETHODIMP nsResProtocolHandler::SetSubstitution(const nsACString & root, nsIURI *baseURI)
  127. {
  128.     return NS_ERROR_NOT_IMPLEMENTED;
  129. }
  130.  
  131. /* nsIURI getSubstitution (in ACString root); */
  132. NS_IMETHODIMP nsResProtocolHandler::GetSubstitution(const nsACString & root, nsIURI **_retval)
  133. {
  134.     return NS_ERROR_NOT_IMPLEMENTED;
  135. }
  136.  
  137. /* boolean hasSubstitution (in ACString root); */
  138. NS_IMETHODIMP nsResProtocolHandler::HasSubstitution(const nsACString & root, PRBool *_retval)
  139. {
  140.     return NS_ERROR_NOT_IMPLEMENTED;
  141. }
  142.  
  143. /* AUTF8String resolveURI (in nsIURI resURI); */
  144. NS_IMETHODIMP nsResProtocolHandler::ResolveURI(nsIURI *resURI, nsACString & _retval)
  145. {
  146.     return NS_ERROR_NOT_IMPLEMENTED;
  147. }
  148.  
  149. /* End of implementation class template. */
  150. #endif
  151.  
  152.  
  153. #endif /* __gen_nsIResProtocolHandler_h__ */
  154.